﻿using UnityEngine;

using System.Collections;

namespace calc
{
    public class OperationFactory
    {
        public static Operation createOperation(string op)
        {
            Operation oper = null;
            switch (op)
            {
                case "+":oper = new OperationAdd(); break;
                case "-":oper = new OperationSub(); break;
                case "*":oper = new OperationMul(); break;
                case "/":oper = new OperationDiv(); break;
                case "%":oper = new OperationQuyu(); break;
                case "tan":oper = new OperationTan(); break;
                case "sin":oper = new OperationSin(); break;
                case "cos":oper = new OperationCos(); break;
                case "ln":oper = new OperationLn(); break;
                case "x!":oper = new OperationJieCheng(); break;
                case "x2":oper = new Operationx2(); break;
                case "x3":oper = new Operationx3(); break;
                case "log":oper = new OperationLog(); break;
                case "1/x":oper = new OperationXfenzhi1(); break;
                case "PI":oper = new OperationPi(); break;

            }

            return oper;
        }

    }
}
